<?php

class Application_Model_Comments {

    public function getPostComment($intPostID) {
         try {
            $dbAdapter = Zend_Registry::get('dbAdapter');
            $stmt = $dbAdapter->query("SELECT * FROM tbl_comment WHERE post_id='$intPostID'");
            $arrResult = $stmt->fetchAll();
        } catch (Exception $exc) {
            echo $exc->getTraceAsString();
        }
        return $arrResult;
    }
    
    public function createComment($arrComment){
          try {
            $dbAdapter = Zend_Registry::get('dbAdapter');
            $dbAdapter->insert('tbl_comment', $arrComment);
        } catch (Exception $exc) {
            echo $exc->getTraceAsString();
        }
    }

}
